Skip to content

feat: support storing different columns in separate files - #20193

Open
SkyFan2002 wants to merge 33 commits into
databendlabs:mainfrom
SkyFan2002:wide
Open

feat: support storing different columns in separate files#20193
SkyFan2002 wants to merge 33 commits into
databendlabs:mainfrom
SkyFan2002:wide

Conversation

@SkyFan2002

@SkyFan2002 SkyFan2002 commented Jul 23, 2026

Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Fuse currently rewrites an entire block for an UPDATE, even when only a subset of columns changes. This PR introduces an opt-in partial UPDATE path that stores updated columns in separate physical column-group files while preserving the semantics of a single logical block.

Partial UPDATE requires both the enable_partial_update table option and session setting. Eligible direct UPDATEs write only the changed fields; operations that update all fields, affect cluster-key dependencies, or otherwise do not meet the eligibility requirements fall back to a full block rewrite.

This PR also:

  • Adds column-group-aware reads for scans, prewhere, row fetch, mutations, compaction, MERGE, and Fuse metadata table functions.
  • Associates ordinary Bloom indexes with their owning column groups and performs fail-open pruning across multiple Bloom files.
  • Preserves compression, change tracking, cluster statistics, and HLL metadata across partial updates.
  • Extends GC and Vacuum reachability to protect active column-group data and paired Bloom files, while cleaning current-format Bloom files associated with deleted data candidates.
  • Keeps legacy block metadata readable and allows legacy and column-group blocks to coexist.

Column-oriented segments, partitioned tables, computed columns, Inverted/Ngram/Vector/Spatial indexes, Fuse virtual columns, and REPLACE INTO are outside the supported partial UPDATE scope.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions Bot added the pr-feature this PR introduces a new feature to the codebase label Jul 23, 2026
SkyFan2002 and others added 26 commits July 24, 2026 00:52
# Conflicts:
#	src/query/storages/common/table_meta/src/meta/v2/segment.rs
#	src/query/storages/fuse/src/io/write/block_writer.rs
#	src/query/storages/fuse/src/io/write/stream/block_builder.rs
#	src/query/storages/fuse/src/operations/changes.rs
#	src/query/storages/fuse/src/operations/common/processors/transform_serialize_block.rs
#	src/query/storages/fuse/src/operations/mutation/meta/mutation_meta.rs
#	src/query/storages/fuse/src/operations/mutation/processors/compact_source.rs
#	src/query/storages/fuse/src/operations/mutation/processors/mutation_source.rs
@SkyFan2002
SkyFan2002 marked this pull request as ready for review July 29, 2026 03:53
@SkyFan2002
SkyFan2002 requested review from dantengsky and zhyass July 29, 2026 03:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c45150b49f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/service/src/physical_plans/physical_mutation.rs
Comment thread src/query/storages/fuse/src/io/write/block_writer.rs
Comment thread src/query/storages/fuse/src/io/write/block_writer.rs
@SkyFan2002

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07225d85e0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/service/src/physical_plans/physical_mutation.rs Outdated
Comment thread src/query/storages/fuse/src/io/write/block_writer.rs Outdated
@SkyFan2002

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1db5ef3644

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/service/src/physical_plans/physical_mutation.rs
@SkyFan2002

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 866fe7c072

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/storages/fuse/src/io/write/block_writer.rs
@SkyFan2002

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 103ae5b508

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/service/src/physical_plans/physical_mutation.rs
@SkyFan2002

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 7c0f6343ad

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@SkyFan2002
SkyFan2002 requested a review from zhang2014 July 31, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant